/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package spynx.desl.proxies.impl;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EPackage;

import org.eclipse.emf.ecore.impl.EPackageImpl;

import spynx.desl.DeslPackage;

import spynx.desl.proxies.JavaTypeProxy;
import spynx.desl.proxies.LocatorProxy;
import spynx.desl.proxies.PatternMatchInfo;
import spynx.desl.proxies.ProxiesFactory;
import spynx.desl.proxies.ProxiesPackage;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model <b>Package</b>.
 * <!-- end-user-doc -->
 * @generated
 */
public class ProxiesPackageImpl extends EPackageImpl implements ProxiesPackage {
	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass patternMatchInfoEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass locatorProxyEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass javaTypeProxyEClass = null;

	/**
	 * Creates an instance of the model <b>Package</b>, registered with
	 * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
	 * package URI value.
	 * <p>Note: the correct way to create the package is via the static
	 * factory method {@link #init init()}, which also performs
	 * initialization of the package, or returns the registered package,
	 * if one already exists.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see org.eclipse.emf.ecore.EPackage.Registry
	 * @see spynx.desl.proxies.ProxiesPackage#eNS_URI
	 * @see #init()
	 * @generated
	 */
	private ProxiesPackageImpl() {
		super(eNS_URI, ProxiesFactory.eINSTANCE);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private static boolean isInited = false;

	/**
	 * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
	 * 
	 * <p>This method is used to initialize {@link ProxiesPackage#eINSTANCE} when that field is accessed.
	 * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #eNS_URI
	 * @see #createPackageContents()
	 * @see #initializePackageContents()
	 * @generated
	 */
	public static ProxiesPackage init() {
		if (isInited) return (ProxiesPackage)EPackage.Registry.INSTANCE.getEPackage(ProxiesPackage.eNS_URI);

		// Obtain or create and register package
		ProxiesPackageImpl theProxiesPackage = (ProxiesPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof ProxiesPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new ProxiesPackageImpl());

		isInited = true;

		// Initialize simple dependencies
		DeslPackage.eINSTANCE.eClass();

		// Create package meta-data objects
		theProxiesPackage.createPackageContents();

		// Initialize created meta-data
		theProxiesPackage.initializePackageContents();

		// Mark meta-data to indicate it can't be changed
		theProxiesPackage.freeze();

  
		// Update the registry and return the package
		EPackage.Registry.INSTANCE.put(ProxiesPackage.eNS_URI, theProxiesPackage);
		return theProxiesPackage;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getPatternMatchInfo() {
		return patternMatchInfoEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getLocatorProxy() {
		return locatorProxyEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getJavaTypeProxy() {
		return javaTypeProxyEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ProxiesFactory getProxiesFactory() {
		return (ProxiesFactory)getEFactoryInstance();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private boolean isCreated = false;

	/**
	 * Creates the meta-model objects for the package.  This method is
	 * guarded to have no affect on any invocation but its first.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void createPackageContents() {
		if (isCreated) return;
		isCreated = true;

		// Create classes and their features
		patternMatchInfoEClass = createEClass(PATTERN_MATCH_INFO);

		locatorProxyEClass = createEClass(LOCATOR_PROXY);

		javaTypeProxyEClass = createEClass(JAVA_TYPE_PROXY);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private boolean isInitialized = false;

	/**
	 * Complete the initialization of the package and its meta-model.  This
	 * method is guarded to have no affect on any invocation but its first.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void initializePackageContents() {
		if (isInitialized) return;
		isInitialized = true;

		// Initialize package
		setName(eNAME);
		setNsPrefix(eNS_PREFIX);
		setNsURI(eNS_URI);

		// Obtain other dependent packages
		DeslPackage theDeslPackage = (DeslPackage)EPackage.Registry.INSTANCE.getEPackage(DeslPackage.eNS_URI);

		// Create type parameters

		// Set bounds for type parameters

		// Add supertypes to classes
		patternMatchInfoEClass.getESuperTypes().add(theDeslPackage.getProxy());
		locatorProxyEClass.getESuperTypes().add(theDeslPackage.getProxy());
		javaTypeProxyEClass.getESuperTypes().add(theDeslPackage.getProxy());

		// Initialize classes and features; add operations and parameters
		initEClass(patternMatchInfoEClass, PatternMatchInfo.class, "PatternMatchInfo", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);

		initEClass(locatorProxyEClass, LocatorProxy.class, "LocatorProxy", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);

		initEClass(javaTypeProxyEClass, JavaTypeProxy.class, "JavaTypeProxy", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);

		// Create resource
		createResource(eNS_URI);
	}

} //ProxiesPackageImpl
